package com.woniuxy.lab.woniu_lab.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.woniuxy.lab.woniu_lab.model.Exper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.lab.woniu_lab.service.dto.experDto.MyExperDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 实验表 Mapper 接口
 * </p>
 *
 * @author Silas
 * @since 2023-03-15
 */
public interface ExperDao extends BaseMapper<Exper> {


    @Select("SELECT le.*,lr.pic\n" +
            "FROM lab_exper le\n" +
            "JOIN lab_range lr\n" +
            "ON le.range_id = lr.id\n" +
            "WHERE le.user_id = #{id} AND le.ctf_or_exper = #{exper}")
    IPage<MyExperDto> getMyExperDtoIPage(@Param("iPage") IPage<Exper> iPage,@Param("id") Integer id,@Param("exper") String exper);
}
